package com.boco.fc.auto.deploy;

import org.apache.log4j.Logger;

public class Main {
	
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		Logger log = Logger.getLogger(Main.class);
		
		if (args.length < 1) {
		    log.info("未请求配置文件路径");
		    log.info("发布示例：sh deploy.sh deploy/20170725/config.xml");
		    log.info("恢复示例：sh recover.sh deploy/20170725/config.xml recover/20170930135913");
		    log.info("恢复指定示例：sh recover.sh deploy/20170725/config.xml recover/20170930135913/192.168.0.10.rcv");
		    log.info("发布结束");
		}else {
			if("recover".equals(args[0])){
				try {
					Recover.getInstance().start(args[1],args[2]);
				} catch (Exception e) {
					log.info("发布失败");
					e.printStackTrace();
				}
			}else{
				try {
					Deploy.getInstance().start(args[1]);
				} catch (Exception e) {
					log.info("发布失败");
					e.printStackTrace();
				}
			}
		    
		}
	}
}
